import copy

CLASS = {
    'ma': {
        'buff':{
            'name':'勇气祝福',
            'lv':35,
            'attack': [39, 41, 43, 44, 45, 47, 49, 50, 52, 53, 54, 56, 58, 59, 61, 62,
                       63, 65, 67, 69, 70, 71, 73, 75, 77, 79, 80, 81, 83, 85, 86, 88,
                       89, 90, 92, 94, 95, 97, 98, 100],
            'intellect': [154, 164, 176, 186, 197, 206, 216, 227, 237, 249, 259, 269, 280, 290,
                          302, 311, 321, 332, 342, 353, 363, 374, 385, 395, 406, 415, 425, 437,
                          447, 458, 468, 478, 489, 500, 511, 520, 530, 541, 551, 563],
            'xs': 665,
            'xyz': (4350, 3500, 3.78880649805069e-05),
        },
        "ty1": {
            'name':'圣光天启',
            'lv':50,
            'intellect': [43, 57, 74, 91, 111, 131, 153, 176, 201, 228, 255, 284, 315, 346, 379,
                          414, 449, 487, 526, 567, 608, 651, 696, 741, 789, 838, 888, 939, 993,
                          1047, 1103, 1160, 1219, 1278, 1340, 1403, 1467, 1533, 1600, 1668],
            'xs': 750,
            'xyz': (5250, 5000, 0.000025),
        },
        'ty3':{
            'name':'祈愿·天使赞歌',
            'lv':100,
            'bind1':1.08,
            'bind2+1':1.23,
            'growth':0.01,
        },
        'damage_increase':1.141,
        'attribute': '智力',
        'skill_form':[
            {
                'name':'勇气祝福+勇气颂歌',
                'multiplier':1.15
            }
        ],
        'passive_skill':[
            {
                'lv':15,
                'out_map':True,
                'name':'启示:颂歌',
                'data':[ 86, 90, 94, 98, 102, 107, 112, 117, 123, 129, 135, 141, 147, 154, 161, 169, 177, 185, 193, 201, 210,
                         219, 229, 238, 248, 258, 269, 279, 290,301,313, 325, 337, 349, 361, 375, 388, 401, 415, 429, 443, 457,
                         473, 487, 503, 519, 535, 551, 567, 584, 598, 614, 630, 646, 662, 677, 693, 709, 725,741,756, 772, 788,
                         804, 820, 835, 851, 867, 883, 899],
            },
            {
                'lv':50,
                'name':'虔诚信念',
                'out_map':False,
                'data':[14 + lv // 2 * 23 + ((lv - 1) // 2) * 22 for lv in  range(100)],
            },
            {
                'lv':75,
                'name':'大天使庇护',
                'out_map':True,
                'data':[140 + lv * 10 for lv in  range(100)]
            },
            {
                'lv':95,
                'name':'圣天使之光',
                'out_map': True,
                'data':[150 + lv * 10 for lv in  range(100)]
            },
        ],
    },
    'gong': {
        'buff':{
            'name': '可爱节拍',
            'lv': 35,
            'attack': [40, 42, 44, 46, 47, 49, 51, 52, 54, 55, 56, 58, 60, 61, 63,
                       64, 65, 67, 70, 72, 73, 74, 76, 78, 80, 82, 83, 84, 86, 88,
                       89, 92, 93, 94, 96, 98, 99, 101, 102, 104],
            'intellect': [162, 173, 186, 196, 207, 217, 227, 239, 249, 262, 272, 283,
                          295, 306, 318, 328, 338, 350, 360, 372, 382, 394, 406, 416,
                          428, 437, 448, 460, 471, 482, 493, 503, 516, 527, 539, 548,
                          559, 570, 581, 593],
            'xs': 665,
            'xyz': (4350, 3500, 3.78880649805069e-05),
        },
        "ty1": {
            'name':'梦想的舞台',
            'lv':50,
            'intellect': [43, 57, 74, 91, 111, 131, 153, 176, 201, 228, 255, 284, 315, 346, 379,
                          414, 449, 487, 526, 567, 608, 651, 696, 741, 789, 838, 888, 939, 993,
                          1047, 1103, 1160, 1219, 1278, 1340, 1403, 1467, 1533, 1600, 1668],
            'xs': 750,
            'xyz': (5250, 5000, 0.000025),
        },
        'ty3':{
            'name':'终曲:霓虹蝶梦',
            'lv':100,
            'bind1':1.08,
            'bind2+1':1.23,
            'growth':0.01
        },
        'damage_increase':1.174,
        'attribute':'精神',
        'skill_form':[{
            'name':'可爱节拍+燃情狂想曲',
            'multiplier':1.1,
        }],
        'passive_skill':[
            {
                'lv':15,
                'out_map': True,
                'name':'多彩感性',
                'data':[276, 280, 284, 288, 292, 297, 302, 307, 313, 319, 325, 331, 337, 344, 351, 359, 367, 375, 383, 391, 400,
                        409, 419, 428, 438, 448, 459, 469, 480,
                        491, 503, 515, 527, 539, 551,
                        565, 578, 591, 605, 619, 633, 647, 663, 677, 693, 709, 725, 741, 757, 774, 788, 804, 820, 836, 852, 867,
                        883, 899, 915, 931, 946, 962, 978, 994,
                        1010, 1025, 1041, 1057, 1073, 1089]},
            {'lv':25,
             'name':'主角登场',
             'out_map': False,
             'data':[999],
             },
            {
                'out_map':False,
                'lv':50,
                'name':'明星气场',
                'data':[14 + lv // 2 * 23 + ((lv - 1) // 2) * 22 for lv in  range(100)]},
            {
                'lv':75,
                'name':'崭新曲风',
'out_map':True,
                'data':[140 + lv * 10 for lv in  range(100)]},
            {
'out_map':True,
                'lv':95,
                'name': '和茉霓之歌',
                'data':[150 + lv * 10 for lv in  range(100)]},
        ],
    },
    'luo': {
        'buff':{
            'name': '禁忌诅咒',
            'lv': 35,
            'attack': [34, 35, 37, 38, 39, 41, 42, 43, 45, 46, 47, 49, 50, 51, 53, 54,
                       55, 57, 58, 60, 61, 62, 64, 65, 66, 68, 69, 70, 72, 73, 74, 76,
                       77, 78, 80, 81, 82, 84, 85, 87],
            'intellect': [131, 140, 149, 158, 167, 175, 184, 193, 202, 211, 220, 229, 238, 247,
                          256, 264, 273, 282, 291, 300, 309, 318, 327, 336, 345, 353, 362, 371,
                          380, 389, 398, 407, 416, 425, 434, 442, 451, 460, 469, 478],
            'xs': 665,
            'xyz': (4350, 3500, 3.78880649805069e-05),
        },
        "ty1": {
            'name': '开幕！人偶剧场',
            'lv': 50,
            'intellect': [43, 57, 74, 91, 111, 131, 153, 176, 201, 228, 255, 284, 315, 346, 379,
                          414, 449, 487, 526, 567, 608, 651, 696, 741, 789, 838, 888, 939, 993,
                          1047, 1103, 1160, 1219, 1278, 1340, 1403, 1467, 1533, 1600, 1668],
            'xs': 750,
            'xyz': (5250, 5000, 0.000025),
        },
        'ty3': {
            'name': '终幕！人偶剧场',
            'lv': 100,
            'bind1': 1.08,
            'bind2+1': 1.23,
            'growth': 0.01
        },
        'damage_increase':1.141,
        'attribute': '智力',
        'skill_form':[
            {
                'name':'禁忌诅咒+疯狂召唤',
                'multiplier':1.25
            },
            {
                'name':'偏爱(禁忌诅咒+疯狂召唤)',
                'multiplier':1.4375
            }
        ],
        'passive_skill':[
            {
                'lv':15,
'out_map':True,
                'name': '人偶操纵者',
                'data':[ 69, 73, 77, 81, 85, 90, 95, 100, 106, 112, 118, 124, 130, 137, 144, 152, 160, 168, 176, 184, 193, 202,
                         212, 221, 231, 241, 252, 262, 273, 284,
                         296, 308, 320, 332, 344, 358, 371, 384, 398, 412, 426, 440, 456, 470, 486, 502, 518, 534, 550, 567, 581,
                         597, 613, 629, 645, 660, 676, 692, 708,
                         724, 739, 755, 771, 787, 803, 818, 834, 850, 866, 882]},
            {
                'lv':50,
'out_map':False,
                'name': '少女的爱',
                'data':[14 + lv // 2 * 23 + ((lv - 1) // 2) * 22 for lv in  range(100)]},
            {
                'lv':75,
'out_map':True,
                'name': '冥月绽放',
                'data':[140 + lv * 10 for lv in  range(100)]},
            {
                'lv':95,
'out_map':True,
                'name': '不祥的微笑',
                'data':[150 + lv * 10 for lv in  range(100)]},
        ],
    },
    'ba': {
        'buff':{
            'name': '荣誉祝福',
            'lv': 35,
            'attack': [44, 45, 47, 49, 50, 52, 54, 55, 57, 59, 60, 62, 64, 65, 67, 69,
                       70, 72, 74, 77, 78, 80, 82, 83, 85, 87, 88, 90, 92, 93, 95, 97,
                       98, 100, 102, 103, 105, 107, 108, 111],
            'intellect': [171, 182, 193, 206, 217, 228, 239, 251, 263, 275, 286, 297, 310, 321,
                          333, 343, 355, 367, 379, 390, 401, 414, 425, 437, 448, 459, 471, 483,
                          494, 505, 518, 529, 541, 552, 565, 575, 587, 598, 609, 622],
            'xs': 620,
            'xyz': (4345, 3498, 0.000035699),
        },
        "ty1": {
            'name': '天启之珠',
            'lv': 50,
            'intellect': [43, 57, 74, 91, 111, 131, 153, 176, 201, 228, 255, 284, 315, 346, 379,
                          414, 449, 487, 526, 567, 608, 651, 696, 741, 789, 838, 888, 939, 993,
                          1047, 1103, 1160, 1219, 1278, 1340, 1403, 1467, 1533, 1600, 1668],
            'xs': 750,
            'xyz': (5250, 5000, 0.000025),
        },
        'ty3': {
            'name': '生命礼赞:神威',
            'lv': 100,
            'bind1': 1.08,
            'bind2+1': 1.23,
            'growth': 0.01
        },
        'damage_increase':1.141,
        'skill_form':[
            {
                'name':'荣誉祝福(24层)',
                'multiplier':None
            }
        ],
        'attribute':'体精',
        'passive_skill':[
            {
                'lv':15,
'out_map':False,
                'name':'守护恩赐',
                'data':[]
            },
            {
                'lv':50,
                'out_map':False,
                'name': '信念光环',
                'data': []
            },
            {
                'lv':95,
                'out_map':False,
                'name': '神之代行者',
                'data': []
            }
        ],
    },
}
DEFAULT_INPUT_DATA = {
    'cp_arms': True,
    "c_attack": 3350,
    "c_intellect": 24500,
    'buff_amount': {
        'in_map':0,
        'out_map':0,
        'enh':0
    },
    'bxy':{
        'enh':0,
        'fixed_attack': 0,
        'fixed_intellect': 0,
        'fixed_ty': 0,
        'percentage_attack': [],
        'percentage_intellect': [],
        'percentage_ty': [],
    },
    'buff':{
        'intellect_out': 0,
        'lv_out': 21,
        'intellect_in': 0,
        'lv_in': 35,
    },
    'ty':{
        'ty1_lv': 37,
        'intellect': 0,
        'ty3_lv': 3,
        "is_ty1": True,
    },
    "skill":{}
}
CONFIG_TEMPLATE={
    'ma':[
        {'name':'测试配置1',
         'data':{'cp_arms': True, 'c_attack': 3350, 'c_intellect': 24500, 'buff_amount': {'in_map': 44, 'out_map': 53333, 'enh': 0}, 'bxy': {'enh': 3, 'fixed_attack': 5, 'fixed_intellect': 2, 'fixed_ty': 2, 'percentage_attack': [2.0], 'percentage_intellect': [3.0], 'percentage_ty': [1.0]}, 'buff': {'intellect_out': 3222, 'lv_out': 21, 'intellect_in': 1111, 'lv_in': 35}, 'ty': {'ty1_lv': 37, 'intellect': 4444, 'ty3_lv': 3, 'is_ty1': True}, 'skill': {0: 3, 1: 4, 2: 5, 3: 1}}
         },
        {'name': '测试配置2',
         'data': {'cp_arms': True, 'c_attack': 3350, 'c_intellect': 24500,
                  'buff_amount': {'in_map': 44, 'out_map': 53333, 'enh': 0},
                  'bxy': {'enh': 3, 'fixed_attack': 5, 'fixed_intellect': 2, 'fixed_ty': 2, 'percentage_attack': [2.0],
                          'percentage_intellect': [3.0], 'percentage_ty': [1.0]},
                  'buff': {'intellect_out': 3, 'lv_out': 21, 'intellect_in': 1111, 'lv_in': 35},
                  'ty': {'ty1_lv': 37, 'intellect': 4444, 'ty3_lv': 3, 'is_ty1': True},
                  'skill': {0: 3, 1: 4, 2: 5, 3: 1}}
         },
        {'name': '测试配置3',
         'data': {'cp_arms': True, 'c_attack': 3350, 'c_intellect': 24500,
                  'buff_amount': {'in_map': 44, 'out_map': 53333, 'enh': 0},
                  'bxy': {'enh': 3, 'fixed_attack': 5, 'fixed_intellect': 2, 'fixed_ty': 2, 'percentage_attack': [2.0],
                          'percentage_intellect': [3.0], 'percentage_ty': [1.0]},
                  'buff': {'intellect_out': 3222, 'lv_out': 21, 'intellect_in': 1111, 'lv_in': 35},
                  'ty': {'ty1_lv': 37, 'intellect': 4444, 'ty3_lv': 3, 'is_ty1': True},
                  'skill': {0: 3, 1: 4, 2: 5, 3: 1}}
         },
    ],
    'ba':[{
        'name':'默认配置',
        'data':copy.deepcopy(DEFAULT_INPUT_DATA)
    }],
    'luo':[{
        'name':'默认配置',
        'data':copy.deepcopy(DEFAULT_INPUT_DATA)
    }],
    'gong':[{
        'name':'默认配置',
        'data':copy.deepcopy(DEFAULT_INPUT_DATA)
    }],
    'last':'ma',
    'record':{i: 0 for i in CLASS}
}

'''
-备忘
DEFAULT_DATA仅可嵌套字典
CLASS里的passive_skill,技能存放顺序要从小到大

QIcon(":/png/84.PNG")

    effect = QGraphicsDropShadowEffect()
    effect.setBlurRadius(10)  # 范围
    effect.setOffset(0, 0)  # 横纵,偏移量
    effect.setColor(Qt.black)  # 颜色
    UI.widget_1.setGraphicsEffect(effect)
    
后续要添加职业要修改的:
    CLASS里增加对应数据,
    SAVE_CONFIG_TEMPLATE增加,
    UI里增加对应职业按钮
--------
add_lv 排序  设置input_text
set_base与init_buff 是否返回
输入规则校验
'''


